#include "stdafx.h"
#include "AlignByMix.h"
#include "LetterCode.h"

int AlignByMix::FindCuttingPoint(wstring& str, int formattingWidth)
{
	using LetterCode::IsAscii;

	int cuttingPointCandidate;

	int i = AlignStrategy::FindCuttingPointSub(str, formattingWidth, &cuttingPointCandidate);

	return (!IsAscii(str[i]) || cuttingPointCandidate == 0)? i : cuttingPointCandidate;
}

AlignByMix::AlignByMix(TextMetrics* tm)
:AlignStrategy(tm)
{
}